#define _CRT_SECURE_NO_WARNINGS 1
void _preorderTraversal(struct TreeNode* root, int* arr, int* returnSize)
{
    if (root == NULL)
        return;

    arr[(*returnSize)++] = root->val;
    _preorderTraversal(root->left, arr, returnSize);
    _preorderTraversal(root->right, arr, returnSize);
}
int* preorderTraversal(struct TreeNode* root, int* returnSize)
{
    int* arr = (int*)malloc(sizeof(int) * 101);
    *returnSize = 0;
    _preorderTraversal(root, arr, returnSize);
    return arr;
}

